package com.sky.mapper;

import com.sky.dto.*;
import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface PeportMapper {
    Double turnoverStatistics(Map map);

    //Integer userStatistics(Map map);
@Select("select count(*) from sky_take_out.user")
Integer userListStatistics();

    List<Orders> setturnoverStatistics(Map map);

    List<Orders> selectturnoverStatistics(Map map);
@Select("select count(*) from sky_take_out.orders")
Integer totalOrderCount();
//@Select("select count(*) from sky_take_out.orders where status=5")
//    Integer validOrderCount(Map map);
@Select(" select cast((select count(*)from orders where status=5)  /count(*) as decimal (10,2)) from orders; ")
    Double orderCompletionRate();

    Integer validOrderCountList(Map map);


    Integer orderCountListlist(Map map);

    List<TurnoverReportDTO> turnoverStatistics(LocalDate begin, LocalDate end);

    List<UserReportDTO> userStatistics(LocalDate begin, LocalDate end);

    List<OrderReportDTO> orderCount(Map map);

    List<OrderReportDTO> validOrderCount(Map map);

    List<SalesTop10ReportDTO> salesTop10ReportVO(LocalDate begin, LocalDate end);

}
